#include"ThreadPool.hpp"
#include<memory>
#include<time.h>

int main()
{
    srand(time(nullptr) ^ getpid());
    EnableConsoleLogStrategy();
    //std::unique_ptr<ThreadPool<Task>> tp = std::make_unique<ThreadPool<Task>>();
    //tp->Start();
    int cnt = 10;
    while(cnt--)
    {
        int x = rand() % 10 + 1;
        usleep(rand() % 131);
        int y = rand() % 5 + 1;
        Task t(x, y);
        //tp->EnQueue(t);
        ThreadPool<Task>::GetInstance()->EnQueue(t);
        sleep(1);
    }
    //tp->Stop();
    ThreadPool<Task>::GetInstance()->Stop();
    //tp->Wait();
    ThreadPool<Task>::GetInstance()->Wait();

    return 0;
}